package com.hebxy.ssm.entity;

import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

public class User {
	
    private Integer id;
    
    @Pattern(regexp="139\\d{8}",message="{card_number.not.correct}",groups={jy1.class})
    @NotNull(message="卡号不能为空")
    private String card_number;
    
    @NotNull(message = "密码不能为null")
	@NotEmpty(message = "密码不允许为''空串")
    @Size(message="长度在6-20之间",max=20,min=6)
    private String password;
    
    @NotNull(message = "用户名不能为null")
	@NotEmpty(message = "用户名不允许为''空串")
    private String username;
    @Range(min=1,max=3,message="套餐只能在1-3之中选择")
    private Integer plan_id;
    
    private String planName;
    
    private double prepaid_amount;//预存金额
    
    private double balance;//剩余金额
    
    private Date register_time;
    
    private Integer status;//状态
    
    private String statusName;
    
    private String role;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getCard_number() {
		return card_number;
	}

	public void setCard_number(String card_number) {
		this.card_number = card_number;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Integer getPlan_id() {
		return plan_id;
	}

	public void setPlan_id(Integer plan_id) {
		this.plan_id = plan_id;
	}

	public String getPlanName() {
		return planName;
	}

	public void setPlanName(String planName) {
		this.planName = planName;
	}

	public double getPrepaid_amount() {
		return prepaid_amount;
	}

	public void setPrepaid_amount(double prepaid_amount) {
		this.prepaid_amount = prepaid_amount;
	}

	public double getBalance() {
		return balance;
	}

	public void setBalance(double balance) {
		this.balance = balance;
	}

	public Date getRegister_time() {
		return register_time;
	}

	public void setRegister_time(Date register_time) {
		this.register_time = register_time;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getStatusName() {
		return statusName;
	}

	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", card_number=" + card_number + ", password=" + password + ", username=" + username
				+ ", plan_id=" + plan_id + ", planName=" + planName + ", prepaid_amount=" + prepaid_amount
				+ ", balance=" + balance + ", register_time=" + register_time + ", status=" + status + ", statusName="
				+ statusName + ", role=" + role + "]";
	}
    
	
	
    
    
}